package com.qf.flash.ui.mine.adapter;

import android.widget.RadioButton;

import com.qf.dblib.dao.entity.ChatUserBean;
import com.qf.flash.R;
import com.qf.flashlib.adapter.BaseRViewItem;
import com.qf.flashlib.adapter.RViewHolder;

/**
 * 创建日期：2020/3/15 on 14:43
 * 描述:
 * 作者:戴旭东
 */
public class InviteFriendItem extends BaseRViewItem<Object> {
    @Override
    public boolean isItemView(Object entity, int position) {
        return entity instanceof ChatUserBean;
    }
    @Override
    public int getItemLayout() {
        return R.layout.item_tole_set;
    }

    @Override
    public void convert(RViewHolder holder, Object entity, int position, int itemSize) {
        ChatUserBean userBean = (ChatUserBean) entity;
        RadioButton rb_chosen = holder.getView(R.id.rb_chosen);
        rb_chosen.setChecked(position == holder.getAdapter().getSingleChosenPosition());

        holder.setText(R.id.tv_name, userBean.getName())
        .setOnClickListener(R.id.rb_chosen);
    }
}
